<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>clientTop/Left</title>
		<style>
			#box {
				width: 100px;
				height: 100px;
				padding: 10px;
				border: 30px solid red;
				overflow-y: auto;
			}
		</style>
	</head>
	<body>
		<div id="box">
			Lorem ipsum, dolor sit amet consectetur adipisicing elit. Rerum molestias et repudiandae consequatur sit quod
			omnis, labore eum vero incidunt cumque commodi itaque officiis? Nemo exercitationem repellendus officiis dolorum
			soluta?
		</div>

		<script>
			// clientTop 和 clientLeft 获取元素的上/左边框宽度
			console.log(box.clientTop) // 30
			console.log(box.clientLeft) // 30
		</script>
	</body>
</html>
